package cn.tedu.cool.controller;

import cn.tedu.cool.entity.Pro;
import cn.tedu.cool.mapper.ProMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class ProController {
@Autowired(required = false)
    ProMapper proMapper;
@RequestMapping("/pro/select")
    public List<Pro> select(){
    return proMapper.select();
}
@RequestMapping("/pro/delete")
    public void deleteById(int id){
    proMapper.deleteById(id);
}
@RequestMapping("/search")
    public List<Pro> selectByWd(String wd){
    return proMapper.selectByWd(wd);
}
    @RequestMapping("/pro/insert")
    public void insert(@RequestBody Pro pro){
        proMapper.insert(pro);
    }
}
